package com.dk.controller;


import com.dk.pojo.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
public class IndexController {
    @RequestMapping("index")
    public String index(){
        return "index";
    }
    @RequestMapping("add")
    public String add(){
    //需要获取登录用户
    //httpsevletrequest
        Subject subject = SecurityUtils.getSubject();
        User user = (User) subject.getPrincipal();
        System.out.println(user.getUsername());
        System.out.println(user.getRealname());
        System.out.println(user.getId());
        System.out.println(user.getPassword());
        return "add";
    }
    @RequestMapping("update")
    public String update(){
        return "update";
    }
    @RequestMapping("delete")
    public String delete(){
        return "delete";
    }
    @RequestMapping("select")
    public String select(){
        return "select";
    }

    @RequestMapping("download")
    public String download(){
        return "ok";
    }

}
